package com.swsc.solarverse.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;

/**
 * @Author anonymous
 * @Date 2021/4/30 00:09
 * @Version: 1.0
 * @Description
 */
@lombok.Data
@Component
public class ResParams {
    @Value("${file.baseDir}")
    private String fileBaseDir;

    @Value("${file.imageDir}")
    private String imageDir;

    @Value("${file.docDir}")
    private String docDir;

    @Value("${tile.path:/data/var/flygo/tile}")
    private String tilePath;

    public static String filePatrolRawImgBaseDir;

    @Value("${file.patrolRawImgBaseDir:/data/var/flygo/data/MINIO}")
    public void setFilePatrolRawImgBaseDir(String filePatrolRawImgBaseDir) {
        ResParams.filePatrolRawImgBaseDir = filePatrolRawImgBaseDir;
    }

    public static String filePedestrianDetectDir;

    @Value("${file.pedestrian.detectDir:/data/var/flygo/data/image/pedestrian}")
    public void setFilePedestrianDetectDir(String filePedestrianDetectDir) {
        ResParams.filePedestrianDetectDir = filePedestrianDetectDir;
    }

    public static String getFilePedestrianDetectDir() {
        return null != ResParams.filePedestrianDetectDir && !"".equals(ResParams.filePedestrianDetectDir.trim()) ? ResParams.filePedestrianDetectDir : "/data/var/flygo/data/image/pedestrian";
    }


    public static Boolean analysisStrData;

    @Value("${analysis.str.data:false}")
    public void setAnalysisStrData(Boolean analysisStrData) {
        ResParams.analysisStrData = analysisStrData;
    }


    public static String baseFileDir;

    @Value("${file.baseDir:/data/var/flygo/data}")
    public void setBaseFileDir(String baseFileDir) {
        ResParams.baseFileDir = baseFileDir;
    }

    public static String getBaseFileDir() {
        return null != ResParams.baseFileDir && !"".equals(ResParams.baseFileDir.trim()) ? ResParams.baseFileDir : "/data/var/flygo/data";
    }

    public static String baseTempFileDir;

    @Value("${file.temp.baseDir:/data/var/flygo/temp}")
    public void setBaseTempFileDir(String baseTempFileDir) {
        ResParams.baseTempFileDir = baseTempFileDir;
    }

    public static String defectImageSetDir;

    @Value("${file.defectImageSetDir:/data/var/flygo/data/ImageDataset}")
    public void setDefectImageSetDir(String defectImageSetDir) {
        ResParams.defectImageSetDir = defectImageSetDir;
    }

    public static String irDefectRecognitionServerUrl;
    public static Double irDefectRecognitionThreshold;

    @Value("${easydl.recognition.ir.serverUrl:http://192.168.0.11:24441/}")
    public void setIrDefectRecognitionServerUrl(String irDefectRecognitionServerUrl) {
        ResParams.irDefectRecognitionServerUrl = irDefectRecognitionServerUrl;
    }

    public static String getIrDefectRecognitionServerUrl() {
        return null != ResParams.irDefectRecognitionServerUrl && !"".equals(ResParams.irDefectRecognitionServerUrl.trim()) ? ResParams.irDefectRecognitionServerUrl : "http://192.168.0.11:24441/";
    }

    @Value("${easydl.recognition.ir.threshold:0.4}")
    public void setIrDefectRecognitionThreshold(Double irDefectRecognitionThreshold) {
        ResParams.irDefectRecognitionThreshold = irDefectRecognitionThreshold;
    }

    public static Double getIrDefectRecognitionThreshold() {
        return null != ResParams.irDefectRecognitionThreshold ? ResParams.irDefectRecognitionThreshold : 0.4;
    }

    public static String irLowCurrentDefectRecognitionServerUrl;
    public static Double irLowCurrentDefectRecognitionThreshold;

    @Value("${easydl.recognition.ir-lowCurrent.serverUrl:http://192.168.0.11:24447/}")
    public void setIrLowCurrentDefectRecognitionServerUrl(String irLowCurrentDefectRecognitionServerUrl) {
        ResParams.irLowCurrentDefectRecognitionServerUrl = irLowCurrentDefectRecognitionServerUrl;
    }

    public static String getIrLowCurrentDefectRecognitionServerUrl() {
        return null != ResParams.irLowCurrentDefectRecognitionServerUrl && !"".equals(ResParams.irLowCurrentDefectRecognitionServerUrl.trim()) ? ResParams.irLowCurrentDefectRecognitionServerUrl : "http://192.168.0.11:24447/";
    }

    @Value("${easydl.recognition.ir-lowCurrent.threshold:0.4}")
    public void setIrLowCurrentDefectRecognitionThreshold(Double irLowCurrentDefectRecognitionThreshold) {
        ResParams.irLowCurrentDefectRecognitionThreshold = irLowCurrentDefectRecognitionThreshold;
    }

    public static Double getIrLowCurrentDefectRecognitionThreshold() {
        return null != ResParams.irLowCurrentDefectRecognitionThreshold ? ResParams.irLowCurrentDefectRecognitionThreshold : 0.4;
    }

    public static String irDefectFilterServerUrl;
    public static Double irDefectFilterThreshold;

    @Value("${easydl.filter.ir.serverUrl:http://192.168.0.11:24442/}")
    public void setIrDefectFilterServerUrl(String irDefectFilterServerUrl) {
        ResParams.irDefectFilterServerUrl = irDefectFilterServerUrl;
    }

    public static String getIrDefectFilterServerUrl() {
        return null != ResParams.irDefectFilterServerUrl && !"".equals(ResParams.irDefectFilterServerUrl.trim()) ? ResParams.irDefectFilterServerUrl : "http://192.168.0.11:24442/";
    }

    @Value("${easydl.filter.ir.threshold:0.4}")
    public void setIrDefectFilterThreshold(Double irDefectFilterThreshold) {
        ResParams.irDefectFilterThreshold = irDefectFilterThreshold;
    }

    public static Double getIrDefectFilterThreshold() {
        return null != ResParams.irDefectFilterThreshold ? ResParams.irDefectFilterThreshold : 0.4;
    }

    public static String elDefectRecognitionServerUrl;
    public static Double elDefectRecognitionThreshold;

    @Value("${easydl.recognition.el.serverUrl:http://192.168.0.11:24448/}")
    public void setElDefectRecognitionServerUrl(String elDefectRecognitionServerUrl) {
        ResParams.elDefectRecognitionServerUrl = elDefectRecognitionServerUrl;
    }

    @Value("${easydl.recognition.el.threshold:0.5}")
    public void setElDefectRecognitionThreshold(Double elDefectRecognitionThreshold) {
        ResParams.elDefectRecognitionThreshold = elDefectRecognitionThreshold;
    }

    public static String getIrDefectRecognitionServer() {
        return ResParams.getIrDefectRecognitionServerUrl().concat("?threshold=").concat(ResParams.getIrDefectRecognitionThreshold().toString());
    }

    public static String getIrLowCurrentDefectRecognitionServer() {
        return ResParams.getIrLowCurrentDefectRecognitionServerUrl().concat("?threshold=").concat(ResParams.getIrLowCurrentDefectRecognitionThreshold().toString());
    }

    public static String getIrDefectFilterServer() {
        return ResParams.getIrDefectFilterServerUrl().concat("?threshold=").concat(ResParams.getIrDefectFilterThreshold().toString());
    }

    public static String getElDefectRecognitionServer() {
        return ResParams.elDefectRecognitionServerUrl.concat("?threshold=").concat(ResParams.elDefectRecognitionThreshold.toString());
    }

    public static String analysisStrLeDiagnoseDevices;

    @Value("${analysis.str.le-diagnose.devices:}")
    public void setAnalysisStrLeDiagnoseDevices(String analysisStrLeDiagnoseDevices) {
        ResParams.analysisStrLeDiagnoseDevices = analysisStrLeDiagnoseDevices;
    }

    public static String ossObjectDirPrefix;

    @Value("${oss.object-dir-prefix:djimedia}")
    public void setOssObjectDirPrefix(String ossObjectDirPrefix) {
        ResParams.ossObjectDirPrefix = ossObjectDirPrefix;
    }

    public static java.util.Set<Long> getAnalysisStrLeDiagnoseDeviceIds() {
        if (null != ResParams.analysisStrLeDiagnoseDevices && !"".equals(ResParams.analysisStrLeDiagnoseDevices)) {
            String[] idStrArr = ResParams.analysisStrLeDiagnoseDevices.split(",");
            if (null != idStrArr && idStrArr.length > 0) {
                java.util.Set<Long> idSet = new HashSet<>(idStrArr.length);
                for (String idStr : idStrArr) {
                    idSet.add(Long.parseLong(idStr));
                }
                return idSet;
            }
        }
        return java.util.Collections.emptySet();
    }

    public static Long waylineScheduleJobInterval;

    @Value("${schedule.task.wayline-job.interval:60}")
    public void setWaylineScheduleJobInterval(Long waylineScheduleJobInterval) {
        ResParams.waylineScheduleJobInterval = waylineScheduleJobInterval;
    }

    public static Boolean useWaylineReportedName;

    @Value("${schedule.task.report.use-wayline-reported-name:false}")
    public void setUseWaylineReportedName(Boolean useWaylineReportedName) {
        ResParams.useWaylineReportedName = useWaylineReportedName;
    }

    public static Boolean analysisStrIuData;

    @Value("${analysis.str.iu.data:true}")
    public void setAnalysisStrIuData(Boolean analysisStrIuData) {
        ResParams.analysisStrIuData = analysisStrIuData;
    }

    public static String easydlRecognitionIrDefectExcludes;

    @Value("${easydl.recognition.ir.defect.excludes:其他,反光}")
    public void setEasydlRecognitionIrDefectExcludes(String easydlRecognitionIrDefectExcludes) {
        ResParams.easydlRecognitionIrDefectExcludes = easydlRecognitionIrDefectExcludes;
    }

    public static List<String> easydlRecognitionIrDefectExcludes() {
        if (null == ResParams.easydlRecognitionIrDefectExcludes || "".equals(ResParams.easydlRecognitionIrDefectExcludes.trim())) {
            return Arrays.asList("其他", "反光");
        }
        return Arrays.asList(ResParams.easydlRecognitionIrDefectExcludes.split(","));
    }

    public static Boolean analysisStrIuLossEEnable;

    @Value("${analysis.str.iu.loss-e.enable:true}")
    public void setAnalysisStrIuLossEEnable(Boolean analysisStrIuLossEEnable) {
        ResParams.analysisStrIuLossEEnable = analysisStrIuLossEEnable;
    }

    public static String collectingDistributingZones;

    @Value("${analysis.str.collecting-distributing.zones:}")
    public void setCollectingDistributingZones(String collectingDistributingZones) {
        ResParams.collectingDistributingZones = collectingDistributingZones;
    }

    /**
     * 低效电流阈值
     */
    public static Double analysisStrLeDiagnoseLowIThreshold;

    @Value("${analysis.str.le-diagnose.low-i.threshold:0.5}")
    public void setAnalysisStrLeDiagnoseLowIThreshold(Double analysisStrLeDiagnoseLowIThreshold) {
        ResParams.analysisStrLeDiagnoseLowIThreshold = analysisStrLeDiagnoseLowIThreshold;
    }

    /**
     * 低效电压阈值
     */
    public static Double analysisStrLeDiagnoseLowUThreshold;

    @Value("${analysis.str.le-diagnose.low-u.threshold:0.5}")
    public void setAnalysisStrLeDiagnoseLowUThreshold(Double analysisStrLeDiagnoseLowUThreshold) {
        ResParams.analysisStrLeDiagnoseLowUThreshold = analysisStrLeDiagnoseLowUThreshold;
    }

    /**
     * 低效功率阈值
     */
    public static Double analysisStrLeDiagnoseLowPThreshold;

    @Value("${analysis.str.le-diagnose.low-p.threshold:0.5}")
    public void setAnalysisStrLeDiagnoseLowPThreshold(Double analysisStrLeDiagnoseLowPThreshold) {
        ResParams.analysisStrLeDiagnoseLowPThreshold = analysisStrLeDiagnoseLowPThreshold;
    }

    public static List<String> collectingDistributingZones() {
        if (null == ResParams.collectingDistributingZones || "".equals(ResParams.collectingDistributingZones.trim())) {
            return java.util.Collections.emptyList();
        }
        return Arrays.asList(ResParams.collectingDistributingZones.split(","));
    }

    public static String openApiZongxinBaseUrl;

    @Value("${open.api.zongxin.base-url:http://192.168.84.243:18805}")
    public void setOpenApiZongxinBaseUrl(String openApiZongxinBaseUrl) {
        ResParams.openApiZongxinBaseUrl = openApiZongxinBaseUrl;
    }

    public static Boolean pedestrianDetectionEnable;

    @Value("${pedestrian.detection.enable:false}")
    public void setPedestrianDetectionEnable(Boolean pedestrianDetectionEnable) {
        ResParams.pedestrianDetectionEnable = pedestrianDetectionEnable;
    }

    public static Boolean getPedestrianDetectionEnable() {
        return null != pedestrianDetectionEnable ? pedestrianDetectionEnable : false;
    }


    public static Boolean irDefectRecognitionMarkVEnable;

    @Value("${easydl.recognition.ir.mark-v.enable:false}")
    public void setIrDefectRecognitionMarkVEnable(Boolean irDefectRecognitionMarkVEnable) {
        ResParams.irDefectRecognitionMarkVEnable = irDefectRecognitionMarkVEnable;
    }

    public static Boolean getIrDefectRecognitionMarkVEnable() {
        return null != ResParams.irDefectRecognitionMarkVEnable ? ResParams.irDefectRecognitionMarkVEnable : false;
    }

    public static boolean waylineBreakpointContinuousEnable;

    @Value("${schedule.task.wayline.breakpoint.continuous.enable:false}")
    public void setWaylineBreakpointContinuousEnable(Boolean waylineBreakpointContinuousEnable) {
        ResParams.waylineBreakpointContinuousEnable = waylineBreakpointContinuousEnable;
    }

    public static Boolean scheduleTaskPatrolTaskAutoEnable;

    @Value("${schedule.task.patrol-task-auto.enable:false}")
    public void setScheduleTaskPatrolTaskAutoEnable(Boolean scheduleTaskPatrolTaskAutoEnable) {
        ResParams.scheduleTaskPatrolTaskAutoEnable = scheduleTaskPatrolTaskAutoEnable;
    }

    public static Boolean scheduleTaskPatrolTaskManualReviewAutoEnable;

    @Value("${schedule.task.patrol-task-manual-review-auto.enable:true}")
    public void setScheduleTaskPatrolTaskManualReviewAutoEnable(Boolean scheduleTaskPatrolTaskManualReviewAutoEnable) {
        ResParams.scheduleTaskPatrolTaskManualReviewAutoEnable = scheduleTaskPatrolTaskManualReviewAutoEnable;
    }



    public static String forwardTransmissionFileDir;

    @Value("${iec104.forward.transmission.file.dir:/data/var/iec104/yc}")
    public void setForwardTransmissionFileDir(String forwardTransmissionFileDir) {
        ResParams.forwardTransmissionFileDir = forwardTransmissionFileDir;
    }

    public static String getForwardTransmissionFileDir() {
        return (null == forwardTransmissionFileDir || "".equals(forwardTransmissionFileDir.trim())) ? "/data/var/iec104/yc" : forwardTransmissionFileDir;
    }

    public static String forwardTransmissionFileBackupDir;

    @Value("${iec104.forward.transmission.file.backup.dir:/data/var/iec104/yc/backup}")
    public void setForwardTransmissionFileBuckupDir(String forwardTransmissionFileBackupDir) {
        ResParams.forwardTransmissionFileBackupDir = forwardTransmissionFileBackupDir;
    }

    public static String getForwardTransmissionFileBackupDir() {
        return (null == forwardTransmissionFileBackupDir || "".equals(forwardTransmissionFileBackupDir.trim())) ? "/data/var/iec104/yc/backup" : forwardTransmissionFileBackupDir;
    }

    public static String collectingDistributingSubmatrixCodes;

    @Value("${analysis.str.collecting-distributing.submatrix-codes:01-02-02,01-02-03,01-03-22,01-06-03,01-06-05,01-06-08,01-06-10,01-06-13,01-06-15,01-06-17,01-06-20,01-06-22,01-06-24,01-06-28,01-06-30,01-06-33,01-06-34}")
    public void setCollectingDistributingSubmatrixCodes(String collectingDistributingSubmatrixCodes) {
        ResParams.collectingDistributingSubmatrixCodes = collectingDistributingSubmatrixCodes;
    }

    public static List<String> collectingDistributingSubmatrixCodes() {
        if (null == ResParams.collectingDistributingSubmatrixCodes || "".equals(ResParams.collectingDistributingSubmatrixCodes.trim())) {
            return java.util.Collections.emptyList();
        }
        return Arrays.asList(ResParams.collectingDistributingSubmatrixCodes.split(","));
    }

    /**
     * 低效电量阈值
     */
    public static Double analysisStrLeDiagnoseLowEThreshold;

    @Value("${analysis.str.le-diagnose.low-e.threshold:10}")
    public void setAnalysisStrLeDiagnoseLowEThreshold(Double analysisStrLeDiagnoseLowEThreshold) {
        ResParams.analysisStrLeDiagnoseLowEThreshold = analysisStrLeDiagnoseLowEThreshold;
    }

    public static String onnxDefectFilterModelPath;

    @Value("${onnx.defect.filter.modelPath:/data/var/flygo/AI/onnx/defect_filter_X.onnx}")
    public void setOnnxDefectFilterModelPath(String onnxDefectFilterModelPath) {
        ResParams.onnxDefectFilterModelPath = onnxDefectFilterModelPath;
    }

    public static String getOnnxDefectFilterModelPath() {
        return null != ResParams.onnxDefectFilterModelPath && !"".equals(ResParams.onnxDefectFilterModelPath) ? ResParams.onnxDefectFilterModelPath : "/data/var/flygo/AI/onnx/defect_filter_X.onnx";
    }

    public static float onnxDefectFilterConfThreshold;

    @Value("${onnx.defect.filter.confThreshold:0.5}")
    public void setOnnxDefectFilterConfThreshold(float onnxDefectFilterConfThreshold) {
        ResParams.onnxDefectFilterConfThreshold = onnxDefectFilterConfThreshold;
    }

    public static float getOnnxDefectFilterConfThreshold() {
        return ResParams.onnxDefectFilterConfThreshold <= 0 ? 0.5F : ResParams.onnxDefectFilterConfThreshold;
    }

    public static String aiModelDefectRecgonType;

    @Value("${ai.model.defect.recgon.type:easydl}")
    public void setAiModelDefectRecgonType(String aiModelDefectRecgonType) {
        ResParams.aiModelDefectRecgonType = aiModelDefectRecgonType;
    }

    public static String getAiModelDefectRecgonType() {
        return (null != ResParams.aiModelDefectRecgonType && !"".equals(ResParams.aiModelDefectRecgonType.trim()) ? ResParams.aiModelDefectRecgonType : "easydl");
    }

    public static String aiModelDefectFilterType;

    @Value("${ai.model.defect.filter.type:easydl}")
    public void setAiModelDefectFilterType(String aiModelDefectFilterType) {
        ResParams.aiModelDefectFilterType = aiModelDefectFilterType;
    }

    public static String getAiModelDefectFilterType() {
        return (null != ResParams.aiModelDefectFilterType && !"".equals(ResParams.aiModelDefectFilterType.trim()) ? ResParams.aiModelDefectFilterType : "easydl");
    }

    public static Double reportExportImageCompressQuality;

    @Value("${schedule.task.report.export.image.compress.quality:0.8}")
    public void setReportExportImageCompressQuality(Double reportExportImageCompressQuality) {
        ResParams.reportExportImageCompressQuality = reportExportImageCompressQuality;
    }

    public static Double getReportExportImageCompressQuality() {
        return (null != ResParams.reportExportImageCompressQuality ? ResParams.reportExportImageCompressQuality : 0.75D);
    }

    public static String onnxPersonDetectModelPath;

    @Value("${onnx.person.detect.modelPath:/data/var/flygo/AI/onnx/pedestrian_fp32_v9.onnx}")
    public void setOnnxPersonDetectModelPath(String onnxPersonDetectModelPath) {
        ResParams.onnxPersonDetectModelPath = onnxPersonDetectModelPath;
    }

    public static String getOnnxPersonDetectModelPath() {
        return null != ResParams.onnxPersonDetectModelPath && !"".equals(ResParams.onnxPersonDetectModelPath) ? ResParams.onnxPersonDetectModelPath : "/data/var/flygo/AI/onnx/pedestrian_fp32_v9.onnx";
    }

    public static String onnxAiComputingPowerUseDevice;

    @Value("${onnx.ai.computing.power.use-device:CPU}")
    public void setOnnxAiComputingPowerUseDevice(String onnxAiComputingPowerUseDevice) {
        ResParams.onnxAiComputingPowerUseDevice = onnxAiComputingPowerUseDevice;
    }

    public static String getOnnxAiComputingPowerUseDevice() {
        return (null != ResParams.onnxAiComputingPowerUseDevice && !"".equals(ResParams.onnxAiComputingPowerUseDevice.trim())) ? ResParams.onnxAiComputingPowerUseDevice : "CPU";
    }

    public static float onnxPedestrianDetectConfThreshold;

    @Value("${onnx.pedestrian.detect.confThreshold:0.5}")
    public void setOnnxPedestrianDetectConfThreshold(float onnxPedestrianDetectConfThreshold) {
        ResParams.onnxPedestrianDetectConfThreshold = onnxPedestrianDetectConfThreshold;
    }

    public static float getOnnxPedestrianDetectConfThreshold() {
        return ResParams.onnxPedestrianDetectConfThreshold <= 0 ? 0.5F : ResParams.onnxPedestrianDetectConfThreshold;
    }

    public static Integer pedestrianDetectionSkipFrameRate;

    @Value("${pedestrian.detection.skip-frame.rate:30}")
    public void setPedestrianDetectionSkipFrameRate(Integer pedestrianDetectionSkipFrameRate) {
        ResParams.pedestrianDetectionSkipFrameRate = pedestrianDetectionSkipFrameRate;
    }

    public static Integer getPedestrianDetectionSkipFrameRate() {
        return null != pedestrianDetectionSkipFrameRate ? pedestrianDetectionSkipFrameRate : 30;
    }

    public static String pedestrianDetectionWarnText;

    @Value("${pedestrian.detection.warn.text:警告, 您已进入危险区域, 请马上离开!}")
    public void setPedestrianDetectionWarnText(String pedestrianDetectionWarnText) {
        ResParams.pedestrianDetectionWarnText = pedestrianDetectionWarnText;
    }

    public static String getPedestrianDetectionWarnText() {
        return null != ResParams.pedestrianDetectionWarnText && !"".equals(ResParams.pedestrianDetectionWarnText.trim()) ? ResParams.pedestrianDetectionWarnText : "警告, 您已进入危险区域, 请马上离开!";
    }

    public static Boolean pedestrianDetectionTestEnable;

    @Value("${pedestrian.detection.test.enable:false}")
    public void setPedestrianDetectionTestEnable(Boolean pedestrianDetectionTestEnable) {
        ResParams.pedestrianDetectionTestEnable = pedestrianDetectionTestEnable;
    }

    public static Boolean getPedestrianDetectionTestEnable() {
        return null != pedestrianDetectionTestEnable ? pedestrianDetectionTestEnable : false;
    }

    public static Boolean scheduleTaskProjectSafetyTaskAutoEnable;

    @Value("${schedule.task.project-safety-task-auto.enable:true}")
    public void setScheduleTaskProjectSafetyTaskAutoEnable(Boolean scheduleTaskProjectSafetyTaskAutoEnable) {
        ResParams.scheduleTaskProjectSafetyTaskAutoEnable = scheduleTaskProjectSafetyTaskAutoEnable;
    }

    public static Boolean getScheduleTaskProjectSafetyTaskAutoEnable() {
        return null != scheduleTaskProjectSafetyTaskAutoEnable ? scheduleTaskProjectSafetyTaskAutoEnable : true;
    }

    public static Boolean scheduleTaskProjectSafetyTaskManualReviewAutoEnable;

    @Value("${schedule.task.project-safety-task-manual-review-auto.enable:true}")
    public void setScheduleTaskProjectSafetyTaskManualReviewAutoEnable(Boolean scheduleTaskProjectSafetyTaskManualReviewAutoEnable) {
        ResParams.scheduleTaskProjectSafetyTaskManualReviewAutoEnable = scheduleTaskProjectSafetyTaskManualReviewAutoEnable;
    }

    public static String onnxProjectSafetyDetectModelPath;

    @Value("${onnx.project-safety.detect.modelPath:/data/var/flygo/AI/onnx/project_safety_detect_X.onnx}")
    public void setOnnxProjectSafetyDetectModelPath(String onnxProjectSafetyDetectModelPath) {
        ResParams.onnxProjectSafetyDetectModelPath = onnxProjectSafetyDetectModelPath;
    }

    public static String getOnnxProjectSafetyDetectModelPath() {
        return null != ResParams.onnxProjectSafetyDetectModelPath && !"".equals(ResParams.onnxProjectSafetyDetectModelPath) ? ResParams.onnxProjectSafetyDetectModelPath : "/data/var/flygo/AI/onnx/project_safety_detect_X.onnx";
    }

    public static float onnxProjectSafetyDetectConfThreshold;

    @Value("${onnx.project-safety.detect.confThreshold:0.5}")
    public void setOnnxProjectSafetyDetectConfThreshold(float onnxProjectSafetyDetectConfThreshold) {
        ResParams.onnxProjectSafetyDetectConfThreshold = onnxProjectSafetyDetectConfThreshold;
    }

    public static float getOnnxProjectSafetyDetectConfThreshold() {
        return ResParams.onnxProjectSafetyDetectConfThreshold <= 0 ? 0.5F : ResParams.onnxProjectSafetyDetectConfThreshold;
    }

    public static float onnxProjectSafetyDetectNmsThreshold;

    @Value("${onnx.project-safety.detect.nmsThreshold:0.45}")
    public void setOnnxProjectSafetyDetectNmsThreshold(float onnxProjectSafetyDetectNmsThreshold) {
        ResParams.onnxProjectSafetyDetectNmsThreshold = onnxProjectSafetyDetectNmsThreshold;
    }

    public static float getOnnxProjectSafetyDetectNmsThreshold() {
        return ResParams.onnxProjectSafetyDetectNmsThreshold <= 0 ? 0.45F : ResParams.onnxProjectSafetyDetectNmsThreshold;
    }

    public static String pjsReportTemplatePath;

    @Value("${report.pjs.template.path:/data/var/flygo/templates/report-template-ycrx-pjs.docx}")
    public void setPjsReportTemplatePath(String pjsReportTemplatePath) {
        ResParams.pjsReportTemplatePath = pjsReportTemplatePath;
    }

    public static String getPjsReportTemplatePath() {
        return null != ResParams.pjsReportTemplatePath && !"".equals(ResParams.pjsReportTemplatePath) ? ResParams.pjsReportTemplatePath : "/data/var/flygo/templates/report-template-ycrx-pjs.docx";
    }

    /**
     * 是否进行报告审核
     */
    public static Boolean scheduleTaskReportAuditEnable;

    @Value("${schedule.task.report.audit.enable:true}")
    public void setScheduleTaskReportAuditEnable(Boolean scheduleTaskReportAuditEnable) {
        ResParams.scheduleTaskReportAuditEnable = scheduleTaskReportAuditEnable;
    }

    public static Boolean getScheduleTaskReportAuditEnable() {
        return null != ResParams.scheduleTaskReportAuditEnable ? ResParams.scheduleTaskReportAuditEnable : false;
    }

    public static Long pedestrianDetectionUavHoverTime;

    @Value("${pedestrian.detection.uav-hover-time:60}")
    public void setPedestrianDetectionUavHoverTime(Long pedestrianDetectionUavHoverTime) {
        ResParams.pedestrianDetectionUavHoverTime = pedestrianDetectionUavHoverTime;
    }

    public static Long getPedestrianDetectionUavHoverTime() {
        return null != pedestrianDetectionUavHoverTime ? pedestrianDetectionUavHoverTime : 60L;
    }

    public static Boolean pedestrianDetectionUavHoverEnable;

    @Value("${pedestrian.detection.uav-hover.enable:false}")
    public void setPedestrianDetectionUavHoverEnable(Boolean pedestrianDetectionUavHoverEnable) {
        ResParams.pedestrianDetectionUavHoverEnable = pedestrianDetectionUavHoverEnable;
    }

    public static Boolean getPedestrianDetectionUavHoverEnable() {
        return null != pedestrianDetectionUavHoverEnable ? pedestrianDetectionUavHoverEnable : false;
    }


    public static Boolean uiDefectTypeSumChartAllDefectsEnable;

    @Value("${ui.defect-type-sum.chart.all-defects.enable:true}")
    public void setUiDefectTypeSumChartAllDefectsEnable(Boolean uiDefectTypeSumChartAllDefectsEnable) {
        ResParams.uiDefectTypeSumChartAllDefectsEnable = uiDefectTypeSumChartAllDefectsEnable;
    }

    public static Boolean getUiDefectTypeSumChartAllDefectsEnable() {
        return null != uiDefectTypeSumChartAllDefectsEnable ? uiDefectTypeSumChartAllDefectsEnable : true;
    }

    public static List<Integer> uiDefectTypeCustomOrganPnos;

    @Value("${ui.defect-type.custom.organ-pnos:100801,100802}")
    public void setUiDefectTypeCustomOrganPnos(List<Integer> uiDefectTypeCustomOrganPnos) {
        ResParams.uiDefectTypeCustomOrganPnos = uiDefectTypeCustomOrganPnos;
    }

    public static List<Integer> getUiDefectTypeCustomOrganPnos() {
        return (null != uiDefectTypeCustomOrganPnos && uiDefectTypeCustomOrganPnos.size() > 0) ? uiDefectTypeCustomOrganPnos : Arrays.asList(100801, 100802);
    }

    public static boolean uiDefectTypeCustomOrganPnosContain(Collection<Integer> organPonIn) {
        if (null != organPonIn && organPonIn.size() > 0) {
            for (Integer organPno : organPonIn) {
                if (ResParams.getUiDefectTypeCustomOrganPnos().contains(organPno)) {
                    return true;
                }
            }
        }

        return false;
    }

    public static Boolean uiDjiHmsUnknowEnable;

    @Value("${ui.dji.hms.unknow.enable:true}")
    public void setUiDjiHmsUnknowEnable(Boolean uiDjiHmsUnknowEnable) {
        ResParams.uiDjiHmsUnknowEnable = uiDjiHmsUnknowEnable;
    }

    public static Boolean getUiDjiHmsUnknowEnable() {
        return null != uiDjiHmsUnknowEnable ? uiDjiHmsUnknowEnable : true;
    }

    public static Integer waylineGenerateWaypointLimit;

    @Value("${wayline.generate.waypoint.limit:500}")
    public void setWaylineGenerateWaypointLimit(Integer waylineGenerateWaypointLimit) {
        ResParams.waylineGenerateWaypointLimit = waylineGenerateWaypointLimit;
    }

    public static Integer getWaylineGenerateWaypointLimit() {
        return null != ResParams.waylineGenerateWaypointLimit ? ResParams.waylineGenerateWaypointLimit : 500;
    }

    public static Integer waylineScheduleJobStartTime;

    @Value("${schedule.task.wayline-job.start-time:9}")
    public void setWaylineScheduleJobStartTime(Integer waylineScheduleJobStartTime) {
        ResParams.waylineScheduleJobStartTime = waylineScheduleJobStartTime;
    }
    public static Integer getWaylineScheduleJobStartTime(){
        return null != ResParams.waylineScheduleJobStartTime ? ResParams.waylineScheduleJobStartTime : 9;
    }

    public static Integer waylineScheduleJobEndTime;

    @Value("${schedule.task.wayline-job.end-time:9}")
    public void setWaylineScheduleJobEndTime(Integer waylineScheduleJobEndTime) {
        ResParams.waylineScheduleJobEndTime = waylineScheduleJobEndTime;
    }
    public static Integer getWaylineScheduleJobEndTime(){
        return null != ResParams.waylineScheduleJobEndTime ? ResParams.waylineScheduleJobEndTime : 15;
    }
    public static String ossEndpointPublic;
    @Value("${oss.endpoint-public:}")
    public void setOssEndpointPublic(String ossEndpointPublic) {
        ResParams.ossEndpointPublic = ossEndpointPublic;
    }
    public static String getOssEndpointPublic(){
        return ResParams.ossEndpointPublic;
    }
    public static Boolean ossEndpointPublicSigned;
    @Value("${oss.endpoint-public-signed:}")
    public void setOssEndpointPublicSigned(Boolean ossEndpointPublicSigned) {
        ResParams.ossEndpointPublicSigned = ossEndpointPublicSigned;
    }
    public static Boolean getOssEndpointPublicSigned(){
        return null != ResParams.ossEndpointPublicSigned ? ResParams.ossEndpointPublicSigned : true;
    }

    public static Boolean scheduleTaskIvNoDeviceSkipEnable;
    @Value("${schedule.task.iv.no-device.skip.enable:false}")
    public void setScheduleTaskIvNoDeviceSkipEnable(Boolean scheduleTaskIvNoDeviceSkipEnable) {
        ResParams.scheduleTaskIvNoDeviceSkipEnable = scheduleTaskIvNoDeviceSkipEnable;
    }
    public static Boolean getScheduleTaskIvNoDeviceSkipEnable(){
        return null != ResParams.scheduleTaskIvNoDeviceSkipEnable ? ResParams.scheduleTaskIvNoDeviceSkipEnable : false;
    }

    public static Boolean scheduleTaskLeDiagnoseEnable;
    @Value("${schedule.task.le.diagnose.enable:false}")
    public void setScheduleTaskLeDiagnoseEnable(Boolean scheduleTaskLeDiagnoseEnable) {
        ResParams.scheduleTaskLeDiagnoseEnable = scheduleTaskLeDiagnoseEnable;
    }
    public static Boolean getScheduleTaskLeDiagnoseEnable(){
        return null != ResParams.scheduleTaskLeDiagnoseEnable ? ResParams.scheduleTaskLeDiagnoseEnable : false;
    }
}
